<template>
    <div>
      home
      <button @click="handleClick">{{city}}</button>
    </div>
</template>

<script>
import axios from 'axios';
// import axiosJsonp from 'axios-jsonp'
export default {
  data(){
    return {
      city:"花山"
    }
  },
  methods:{
    handleClick(){
      this.$router.push("/city")
    }
  },
  mounted(){
    var city = localStorage.getItem("city");
    if(city){
      this.city = city;
    }
    /* var url='https://apis.map.qq.com/ws/location/v1/ip?key=YGQBZ-POB3P-5JODH-VCNLQ-HDVNJ-FKBZF&output=jsonp'
    axios({
      url,
      adapter:axiosJsonp
    }).then(res=>{
      console.log(res);
    }) */
    axios({
      url:'http://47.108.197.28:3000/top/playlist',
      method:"get",
      params:{
        limit:1
      }
    }).then(res=>{
      console.log(res);
    })
  }

}
</script>

<style>

</style>